

package top.continew.admin.question.user.service;

import top.continew.admin.question.model.question.UserDoQuestion;
import top.continew.admin.question.model.question.UserDoQuestionSet;
import top.continew.admin.question.user.service.question.enums.ProblemStateEnum;
import top.continew.admin.question.user.service.questionset.entity.AbstractQuestionSet;

import java.util.List;

public interface IUserQuestionService {

    /**
     * 获取用户答题记录
     *
     * @param userId        用户id
     * @param questionSetId 题库id
     */
    UserDoQuestionSet getUserDoQuestionSet(Long userId, String questionSetId);

    /**
     * 保存用户答题记录
     *
     * @param userDoQuestion 用户答题记录
     * @param index
     * @param questionSet
     */
    void saveUserQuestion(List<UserDoQuestion> userDoQuestion, Long index, AbstractQuestionSet questionSet);

    /**
     * 根据用户答题记录查询
     *
     * @param userId        用户id
     * @param questionSetId 题库id
     */
    List<UserDoQuestion> getListByUserId(Long userId, String questionSetId);

    /**
     * 根据用户答题记录查询
     *
     * @param userId 用户id
     */
    List<UserDoQuestion> getAllListByUserId(Long userId, String questionSetId, Long specificationType);

    /**
     * 做题记录
     *
     * @param questionId    题目id
     * @param questionSetId 题集id
     * @return 做题记录
     */
    UserDoQuestion getInfo(Long userId, Long questionId, Long questionSetId);

    /**
     * 重新练习
     */
    void clearQuestionSetRecord(long questionSetId, Long userId);

    /**
     * 获取用户做题天数
     */
    Long getDoQuestionDay(Long userId, Long specificationType);

    /**
     * 上次做题数量（按天）
     */
    Long getQuestionLastTimeDoSum(Long userId, Long specificationType);

    /**
     * 今日做题
     */
    Long getQuestionTodayDoSum(Long userId, Long specificationType);

    /**
     * 获取用户做题总数
     */
    long getDoQuestionSum(Long userId, Long questionSetId);

    /**
     * 获取用户做题总数
     */
    long getDoQuestionSum(Long userId, Long questionSetId, ProblemStateEnum problemStateEnum);

    /**
     * 获取用户做题总数
     */
    Long getDoQuestionSumBySpecificationType(Long userId, Long specificationType);

    /**
     * 进度
     */
    Long getUserIndex(Long userId, long questionSetId);

    /**
     * 查询题目
     */
    UserDoQuestion getDoQuestionInfo(long questionSetId, Long userId, Long questionId);
}
